package exam.web.action;

import exam.common.util.NullCheckUtil;
import exam.web.action.base.UserActionBase;

public class DeleteUserAction extends UserActionBase {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public String execute() throws Exception {
		String userId = request.getParameter("userId");
		if (NullCheckUtil.isNUll(userId)) {
			return ERROR;
		}
		if (userDAO.deleteUser(Long.valueOf(userId))) {
			addActionMessage(getText("Xóa thành công #" +userId));
			return SUCCESS;
		}
		return ERROR;
	}
}
